import React, { Component, Fragment } from 'react'
import {CounterProvider} from '../CounterStore'
import {default as Counter} from '../Counter'
import {default as CountBtn} from '../CountBtn'

import withCopyRight from '../../withCopyRight'

//export default class MyTopApp extends Component {
class MyTopApp extends Component {
    render() {
        return (
            <Fragment>
                <p>我在高阶组件中传递过来的哦={this.props.paramVal}</p>
                // 所有被CounterProvider包裹的组件，CounterProvider的状态都是共享的
                <CounterProvider>
                    {/* 通过children传递运算符号 */}
                    <CountBtn type="decrement">-</CountBtn>
                    <Counter />
                    <CountBtn type="increment">+</CountBtn>
                </CounterProvider>
            </Fragment>
        )
    }
}

export default withCopyRight(MyTopApp)
